package com.felix.test;

import java.util.HashMap;

import org.junit.Test;

import com.g3net.tool.HttpUtils;

public class HttpTest2 {
	
	@Test
	public void testIndex() {
		// String
		// url="http://localhost:8080/shun2/Auto?funid=4&tid=1&uid=8&sid=11&sit=1&fp=广东省佛山市三水区地方税务局&tp=广东省东莞市虎门镇社会保障分局&tim=2013-04-21&rtim=2013-05-05&mark=不要吸烟的";

		// String
		// url="http://x.huango.cn:8083/shun/Auto?funid=4&tid=1&uid=8&sid=11&sit=1&fp=广东省佛山市三水区地方税务局&tp=广东省东莞市虎门镇社会保障分局&tim=2013-04-21&rtim=2013-05-05&mark=不要吸烟的";

//		String url = "http://localhost:8080/shun2/Auto?funid=3&tid=0&sid=0&key=dg";
		String url="http://localhost:8080/shun2/Auto?funid=6&tid=0&sid=0&cid=462&send=18&rec=14";
		String msg = null;
		try {
			msg = HttpUtils.post(url, new HashMap<String, String>(), "utf-8",
					"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println(msg);
	}
	
	@Test 
	public void ser(){
		String abd="asfgrg||fswgshs";
		System.out.println(abd.indexOf("||"));
	}
	@Test
	public void testSSS() {
		// String
		// url="http://localhost:8080/shun2/Auto?funid=4&tid=1&uid=8&sid=11&sit=1&fp=广东省佛山市三水区地方税务局&tp=广东省东莞市虎门镇社会保障分局&tim=2013-04-21&rtim=2013-05-05&mark=不要吸烟的";

		// String
		// url="http://x.huango.cn:8083/shun/Auto?funid=4&tid=1&uid=8&sid=11&sit=1&fp=广东省佛山市三水区地方税务局&tp=广东省东莞市虎门镇社会保障分局&tim=2013-04-21&rtim=2013-05-05&mark=不要吸烟的";

		String url = "http://localhost:8083/shun2/Auto?funid=11&tid=1&cid=433&send=18&rec=14&pmkey=21";
		String msg = null;
		try {
			msg = HttpUtils.post(url, new HashMap<String, String>(), "utf-8",
					"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println(msg);
	}
	@Test
	public void testSearch() {
		// String
		// url="http://localhost:8080/shun2/Auto?funid=4&tid=1&uid=8&sid=11&sit=1&fp=广东省佛山市三水区地方税务局&tp=广东省东莞市虎门镇社会保障分局&tim=2013-04-21&rtim=2013-05-05&mark=不要吸烟的";

		// String
		// url="http://x.huango.cn:8083/shun/Auto?funid=4&tid=1&uid=8&sid=11&sit=1&fp=广东省佛山市三水区地方税务局&tp=广东省东莞市虎门镇社会保障分局&tim=2013-04-21&rtim=2013-05-05&mark=不要吸烟的";

		String url = "http://localhost:8080/shun2/Auto?funid=3&tid=0&sid=0&fp=广州&tp=湛江";
		String msg = null;
		try {
			msg = HttpUtils.post(url, new HashMap<String, String>(), "utf-8",
					"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println(msg);
	}
	@Test
	public void testRe() {

		String url = "http://localhost:8080/shun2/Auto?funid=4&tid=1&uid=7&sid=10&sit=5&fp=广东省佛山市三水区地方税务局&tp=广东省东莞市虎门镇社会保障分局&tim=2013-04-21&rtim=2013-05-05&mark=不要吸烟的";
		String msg = null;
		try {
			msg = HttpUtils.post(url, new HashMap<String, String>(), "utf-8",
					"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println(msg);
	}
	@Test
	public void testyes() {

		String url = "http://localhost:8080/shun2/Auto?funid=6&tid=1&sid=1&cid=491&send=9&rec=7&seat=3";
		String msg = null;
		try {
			msg = HttpUtils.post(url, new HashMap<String, String>(), "utf-8",
					"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println(msg);
	}	
	@Test
	public void testyes2() {

		String url = "http://localhost:8080/shun2/Auto?funid=6&tid=1&sid=1&cid=489&send=9&rec=7&seat=1";
		String msg = null;
		try {
			msg = HttpUtils.post(url, new HashMap<String, String>(), "utf-8",
					"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println(msg);
	}
	//移除乘客   send是车主
	@Test
	public void testyes3() {

		String url = "http://localhost:8080/shun2/Auto?funid=6&tid=0&sid=0&cid=491&send=7&rec=9";
		String msg = null;
		try {
			msg = HttpUtils.post(url, new HashMap<String, String>(), "utf-8",
					"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println(msg);
	}
	//乘客取消预订   send是乘客
	@Test
	public void testyes4() {

		String url = "http://localhost:8080/shun2/Auto?funid=6&tid=0&sid=1&cid=490&send=8&rec=7";
		String msg = null;
		try {
			msg = HttpUtils.post(url, new HashMap<String, String>(), "utf-8",
					"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println(msg);
	}
	
}
